<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
 <%@include file="/html/init.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; ">
<title>Insert title here</title>
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/main.css" />
</head>
<body>
<%
String url = PortalUtil.getCurrentURL(request);
List<Hotel> hotels = null;
%>

<script>
$(document).ready(function(){
$("button.tab").click(function () {
$(".active").removeClass("active");
$(this).addClass("active");
$(".content").hide();
var content_show = $(this).attr("title");
$("#"+content_show).show();
});
});
</script>

<div id="tabbed_box_1" class="tabbed_box">
<div class="tabbed_area">

<ul class="tabs">
<li><button  title="content_0" class="tab active">Tat ca</button></li>
<li><button  title="content_1" class="tab "> 1 sao</button></li>
<li><button  title="content_2" class="tab"> 2 sao</button></li>
<li><button  title="content_3" class="tab"> 3 sao</button></li>
<li><button  title="content_4" class="tab"> 4 sao</button></li>
<li><button  title="content_5" class="tab"> 5 sao</button></li>
</ul>


<div style="display: block;" id="content_0" class="content">
<!-- nội dung của tab0 Tat Ca Khach San -->

<%

	hotels = HotelLocalServiceUtil.getAll();


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>

</div>

<div style="display: none;" id="content_1" class="content">
<!-- nội dung của tab3 -->

<%

	hotels = HotelLocalServiceUtil.getByQuality(1);


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>

<!-- END nội dung của tab1 -->
</div>

<div style="display: none;" id="content_2" class="content">
<!-- nội dung của tab2 -->

<%

	hotels = HotelLocalServiceUtil.getByQuality(2);


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>


<!-- END nội dung của tab2 -->
</div>

<div style="display: none;" id="content_3" class="content">
<!-- nội dung của tab3 -->

<%

	hotels = HotelLocalServiceUtil.getByQuality(3);


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>

<!-- END nội dung của tab4 -->
</div>


<div style="display: none;" id="content_4" class="content">
<!-- nội dung của tab3 -->

<%

	hotels = HotelLocalServiceUtil.getByQuality(4);


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>

<!-- END nội dung của tab5 -->
</div>


<div style="display: none;" id="content_5" class="content">
<!-- nội dung của tab3 -->

<%

	hotels = HotelLocalServiceUtil.getByQuality(5);


if(hotels.isEmpty() || hotels == null)
{
	%>
	<h1>Khong co khach san nao duoc tim thay</h1>
	<%
}
else
{
	
	%>
	
	
	<table >
			<%
				int i = 0; 
				int size = hotels.size();
				while(i<(size/4))
				{
					%>
						<tr>
						<%
						for(int j = 0 ; j<4; j++ )
						{
							%>
								<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<%
						}
						
						%>
						</tr>
					<%
					i+=4;
				}
				if((size%4)>0)
				{
					%>
					<tr>
					<%
						for(int j = 0 ; j<size%4; j++)
						{
							%>
							<td class="img">
								
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><img width="100px" height="100px" src="<%=hotels.get(i+j).getImage()%>"/></a>
									<div class="desc">
									<a href="<%=url+"?hotelId="+hotels.get(i+j).getHotelId()%>"><%=hotels.get(i+j).getHotelName() %></a> 
									</div>	
								</td>
							<% 
						}
					%>
					</tr>
					<%
				}
			%>
		</table>
	
	<%
	
	
}
%>

<!-- END nội dung của tab3 -->
</div>

</div>
</div>
</body>
</html>